import React from "react";
import {
  G2,
  Chart,
  Geom,
  Axis,
  Tooltip,
  Coord,
  Label,
  Legend,
  View,
  Guide,
  Shape,
  Facet,
  Util
} from "bizcharts";

class Basiccolumn extends React.Component {
  render() {
    const data = this.props.data;
    const flag = this.props.flag;
    const cols = this.propscols;
    return (
      <div>
        <Chart padding={[ 30, 50, 50, 60]} width={window.innerWidth}
          height={window.innerHeight - 220} data={data} scale={cols} forceFit>
          <Axis name="x" />
          <Axis name="z" />
          {flag ? <Axis name="y"  label={{
          		formatter(text, item, index) {
          			if(index == 0){
          			}else if(index  == 1){
          				return `四级警长`;
          			}else if(index  == 2){
          				return `三级警长`;
          			}else if(index  == 3){
          				return `二级警长`;
          			}else if(index  == 4){
          				return `一级警长`;
          			}
          		}
          	}} /> : <Axis name="y" />}
          <Tooltip
            crosshairs={{
              type: "y"
            }}
          />
          <Geom type="interval" position="x*y" />
        </Chart>
      </div>
    );
  }
}

export default Basiccolumn;
